using System;
using System.Collections.Generic;
using System.Text;
using Domain.Core;

namespace Ordering.Domain
{
    public partial class Order
    {
        /// <summary>
        /// Base class that all STATE classes for the <see cref="Order"/> class should derive from.
        /// </summary>
        public abstract class OrderState
        {
            # region Fields

            private Order _order;

            # endregion

            # region Constructor

            public OrderState(Order order)
            {
                _order = order;
            }

            # endregion

            # region State Change Methods

            public virtual void Processing()
            {
                throw new InvalidOperationException("The state change is not permitted from the current state.");
            }

            # endregion

            # region Proprties

            /// <summary>
            /// The <see cref="Order"/> that this state is for.
            /// </summary>
            protected Order Order
            {
                get
                {
                    return _order;
                }
            }

            # endregion

            # region Abstract Members

            /// <summary>
            /// Gets an enum value that describes the state.
            /// </summary>
            public abstract OrderStateKind Kind
            { 
                get;
            }

            # endregion
        }
    }
}
